Repository navigation
ltm-organize: a value your code reads belongs in a topic, not only in text - #53
Open
alberttwong wants to merge 1 commit into
Open
alberttwong wants to merge 1 commit into
alberttwong wants to merge 1 commit into
Conversation
`ltm-organize` already says not to stuff structured signals into `text`, and its examples follow that for the *scoping* fields — `owner_id`, `namespace`, `topics`. But the **value** in every example lives only in the prose: `topics: ["ui", "theme"]` with "dark mode" appearing nowhere but the sentence. An agent following the page verbatim therefore ships a record whose value can only be recovered by re-parsing that sentence or by a similarity search. Reword the sentence — a copy edit, a typo fix — and every stored record becomes unreadable and the caller falls back to its default. Nothing raises an error. We shipped exactly that in a product built on Agent Memory, found it later, and fixed it by moving the value into a `key:value` topic. So this adds the step the page stops one short of: - put the value in a topic (`theme:dark`); the sentence stays as prose for humans and for similarity, and nothing parses it - decode against your own allowed set, because a record can carry any string and an unrecognised value must read as unset rather than reach the UI - filter on the topic, which the sentence never allowed - rule of thumb: if rewording `text` would change what your application does, the value is in the wrong field - reading one known record is a `get` by id, not a search — a threshold slightly too strict returns nothing and the caller cannot tell "unset" from "not found", so the setting applies intermittently Also records that `memory_type` is a **closed** set. The field's API description mentions a "custom type registered on the store", which reads as an invitation; an unregistered value is rejected with `400 … memory type "preference" is not registered on this store`. Use `semantic` and put the discriminator in `topics`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
One reference file:
skills/iris-development/references/ltm-organize.md(+ the vendored copy vianpm run sync:plugins). Two added sections, no existing guidance removed.Why
ltm-organizealready teaches the right principle — its Incorrect block calls out "structured signals hidden inside free text". But the page's own Correct examples only apply that to the scoping fields. The value lives in the prose:uiandthemeare categories. "dark mode" — the thing an application actually branches on — appears nowhere but the sentence. So an agent following this page verbatim ships a record whose value can only be recovered by re-parsing that sentence or by running a similarity search over it.That is a silent-failure generator. Reword the sentence — a copy edit, a typo fix, a change of tone — and every stored record becomes unreadable, the caller falls back to its default, and nothing raises an error. A copy edit becomes a data-loss event, discovered months later as "that feature never worked".
This is not hypothetical. We shipped it in a product built on Agent Memory: user display preferences written as an English sentence and read back by exact string match against a table of those sentences. It worked. It would have kept working right up until someone edited the string. Found and fixed by moving the value into a
key:valuetopic; the page is one step short of the guidance that would have prevented it.What was added
1. A value your code reads must live in a structured field, not only in
text.key:valuetopic —theme:dark. Topics are filterable and round-trip verbatim, colon included.theme=darkwould be unpleasant to come across. Nothing parses it.theme:chartreusemust read as unset — your default — rather than reaching the UI as a value it has never heard of. Shown with code, because "validate it" is the step people skip.filter_={"topics": {"all": ["theme:dark"]}}.textwould change what your application does, the value is in the wrong field.getby id, not a search. A threshold slightly too strict returns nothing, and the caller cannot distinguish "unset" from "not found" — so the setting applies intermittently, which is worse than one that never applies.2.
memory_typeis a closed set.semantic/episodic/messageare the only accepted values. The API field description mentions a "custom type registered on the store", which reads as an invitation — we took it, and got:We could not find a registration route in the SDK, the models, or the docs. One line saying the set is closed saves the next person that detour, and points them at
topics, which is filterable witheq/in/alland needs no registration.Validation
skills/edited,plugins/redis-development/skills/regenerated withnpm run sync:plugins, nothing hand-edited underplugins/.Evals — not run, and why
Per CONTRIBUTING this is a meaningful content change and should carry evals; I have not run them, so please treat that as an open item rather than an omission I am arguing past.
The suite needs
ANTHROPIC_SKILL_CREATOR_PATHand theclaudeCLI, andevals/iris-development/agent-memory/model-matrix.jsonis 3 models × 2 configurations × 2 repetitions over 6 evals — ~72 agent runs plusclaude-sonnet-5judging. That is real spend I was not in a position to authorize on this account.The eval that covers this change is #5,
organize-and-scope-search— it is the one whose behaviour could move, in either direction, so it is the one worth re-running before merge. Happy to run the suite and attach the "Against Baseline" screenshots if someone can point me at a sanctioned budget, or for a maintainer to run it.Manual validation instead
Measured against a provisioned Agent Memory store, not asserted:
result_detail:fullcomes back as["preferences", "result_detail:full"]— the colon survives, sokey:valueis usable as written. Also checkedresult-detail-fullandresult_detail=full; all three unchanged.textat runtime and re-reading still returnsfull. Under the previous prose-matching code the same test returned the default. That is the before/after in one line.memory_type: "preference"reproduces the 400 above;semanticis accepted.Full context in the originating change: alberttwong/networkdex#40.
🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes to iris-development reference material; no runtime or API code paths modified.
Overview
Extends
ltm-organize.md(source skill + vendoredplugins/redis-developmentcopy) with two guidance blocks—no existing text removed.Values application code branches on must not live only in
text. The doc now recommendskey:valuetopics (e.g.theme:dark), keeping prose for humans/semantic search, with Python/TypeScript create examples, safe decoding against an allowlist, topic-based filters, a rule of thumb about rewordingtext, and a note togetby id for known settings instead of similarity search.memory_typeis documented as a closed set (semantic/episodic/message); unregistered types (e.g.preference) return 400, with direction to usetopicsfor domain discriminators instead.Reviewed by Cursor Bugbot for commit 997cbc8. Bugbot is set up for automated code reviews on this repo. Configure here.